package com.wyh.mapper.g3mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wyh.domain.dto.g3dto.G3BillingItemsDto;
import com.wyh.domain.po.g3po.BillingItems;
import com.wyh.domain.po.g3po.G3Contractitem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface G3BillingItemsMapper extends BaseMapper<BillingItems> {

    List<G3BillingItemsDto> findByPage(@Param("offset") int offset, @Param("limit") int limit, @Param("feeclassificationid") int feeclassificationid, @Param("name") String name );

    BillingItems getBillingItemsAndPriceById(@Param("id") Integer id);

    //根据合同id获取所有周期性计费和三表类计费
    BillingItems getPeriodicbillingAndThreeMeterbillingById(@Param("id") Integer id);

    BillingItems getBillingItemsByContract(G3Contractitem g3Contractitem);

    //通过费项id，修改费项名称 ty
    List<G3Contractitem> updateName(Integer item);

    //根据合同费项里的费项id获取费项类型
    int getBillType(G3Contractitem g3Contractitem);

    Integer countTotal(@Param("feeclassificationid") int feeclassificationid, @Param("name") String name);

    //通过id查找
    BillingItems findById(int id);

    BillingItems selectById(int id);

    int insert(BillingItems billingItems);

    int updateById(BillingItems billingItems);


    int findByname(String name,int parentid);

    int getParentById(int id);

    int getOrganizationId(int id);

}
